import java.util.Random;
import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: wangj
 * Date: 2022-01-28
 * Time: 5:53
 */
public class TestDemo {
    public static void main(String[] args) {
        Random random=new Random();//默认随机种子是系统时间
        int num=random.nextInt(100);
        Scanner sc=new Scanner(System.in);
        while(true){
            System.out.print("Please enter a number(1-100):");
            int n= sc.nextInt();
            if(n<num){
                System.out.println("Guess small!");
            }
            else if(n>num){
                System.out.println("Guess big!");
            }
            else{
                System.out.println("You guessed right!");
                break;
            }
        }
        sc.close();
    }
}
